classdef AbstractController < handle
    %ABSTRACTCONTROLLER defines the basic structure of a Controller.
    
    properties
        device
        port
        param
        waveform
    end
    
    methods
        function obj = AbstractController(device, port)
            %SIGNALCONTROLLER needs a 'device' and a 'port' as input
            %parameters. A Controller class mush implement 'setDC', 'setAC' and
            %'setAWG' methods.
            obj.device = device;
            obj.port = port;
        end
        
        function disp(obj)
            if isnumeric(obj.port)
                infoStr = sprintf('[%s] of device [%s] port [%d]:', class(obj), obj.device.getDeviceName(), obj.port);
            else
                infoStr = sprintf('[%s] of device [%s] port [''%s'']:', class(obj), obj.device.getDeviceName(), obj.port);
            end
%             infoStr = sprintf('[%s] of device [%s] port [''%s'']:', class(obj), obj.device.getDeviceName(), portname);
            fprintf('%s\n', infoStr);
            fprintf([repmat('-', 1, length(infoStr)), '\n']);
            
            disp(obj.param);
            
            waveformStr = 'Current Waveform Settings:';
            fprintf('%s\n', waveformStr);
            fprintf([repmat('-', 1, length(waveformStr)), '\n']);
            disp(obj.waveform);
        end
    end
    
    methods (Abstract)
        setDC(obj, value)
        setAC(obj, varargin)
        setAWG(obj, waveform, varargin)
    end
end

